home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / cmdity / yk212src.lha / Yak_2.12_Src / locale / yak_c.sd < prev    next >
Text File  |  1995-10-18  |  2KB  |  118 lines

  1. ##stringtype C
  2. ##shortstrings
  3. /****************************************************************
  4.    This file was created automatically by `%fv'
  5.    from "%f0".
  6.  
  7.    Do NOT edit by hand!
  8. ****************************************************************/
  9.  
  10.  
  11. #include <clib/locale_protos.h>
  12.  
  13. #ifdef AZTEC_C
  14. #include <pragmas/locale_lib.h>
  15. #endif /*   AZTEC_C         */
  16.  
  17. #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__MAXON__)
  18. #include <proto/exec.h>
  19. #include <proto/locale.h>
  20. #endif  /*  __SASC  ||  _DCC  ||  __MAXON__ */
  21.  
  22. #ifdef __GNUC__
  23. #include <inline/locale.h>
  24. #endif  /*  __GNUC__    */
  25.  
  26.  
  27. #include "Requesters.h"
  28.  
  29. struct Library *LocaleBase;
  30. struct Locale *locale;
  31. static struct Catalog *Yak_Catalog = NULL;
  32.  
  33. #define Yak_Catalog_Version 20L
  34.  
  35.  
  36. #if defined(CONV) || defined(PREFS)
  37.  
  38. struct FC_Type
  39. {   LONG   ID;
  40.     STRPTR Str;
  41. };
  42.  
  43.  
  44. char 
  45. *getString(APTR fcstr)
  46.   STRPTR defaultstr;
  47.   LONG strnum;
  48.  
  49.   strnum = ((struct FC_Type *) fcstr)->ID;
  50.   defaultstr = ((struct FC_Type *) fcstr)->Str;
  51.  
  52.   return(Yak_Catalog ? GetCatalogStr(Yak_Catalog, strnum, defaultstr) :
  53.                       defaultstr);
  54. }
  55.  
  56. const struct FC_Type _%i = { %d, %s };
  57.  
  58. #else
  59.  
  60. /* The wbstartup program doesn't need all the builtin strings to be
  61.  * included into its own code because it uses only a small part of the
  62.  * strings. So, we used an optimized definition of builtin strings.
  63.  */
  64.  
  65.  
  66. char 
  67. *getString(APTR idstr)
  68.     char *local;
  69.  
  70.     local = (char *)idstr + 1;
  71.     if (LocaleBase)
  72.         return ((char *)GetCatalogStr (Yak_Catalog, *(UBYTE *)idstr, local));
  73.     return (local);
  74. }
  75.  
  76.  
  77. #endif
  78.  
  79. /* open locale library and catalog */
  80. void
  81. OpenLocaleStuff(char *language)
  82. {
  83.     
  84.     if (LocaleBase = OpenLibrary("locale.library", 38L))
  85.     {
  86.         if (!(locale = OpenLocale(NULL)))
  87.         {       
  88.             PostError("No locale set!");
  89.             CloseLibrary(LocaleBase);
  90.             LocaleBase = NULL;
  91.         }
  92.  
  93.         Yak_Catalog = OpenCatalog(locale, "yak.catalog", 
  94.                                   OC_BuiltInLanguage, "english", 
  95.                                   OC_Language, language,        
  96.                                   OC_Version, Yak_Catalog_Version, 
  97.                                   TAG_DONE );
  98.     }       
  99. }
  100.  
  101.  
  102. void
  103. CloseLocaleStuff(void)
  104. {
  105.     if (LocaleBase)
  106.     {
  107.         CloseCatalog (Yak_Catalog); 
  108.         CloseLocale(locale);
  109.         CloseLibrary(LocaleBase);
  110.     }
  111. }
  112.  
  113.  
  114.  
  115.  
  116.